﻿#region Using Statements

#endregion

namespace DirectZZT.Shared.Audio
{
    /// <summary>
    /// Defines mechanisms for a type that plays audio.
    /// </summary>
    public interface IAudioManager
    {
        /// <summary>
        /// Gets/sets whether or not the audio system is enabled.
        /// </summary>
        bool Enabled { get; set; }
        /// <summary>
        /// Gets/sets whether or not the sound is muted.
        /// </summary>
        bool IsMuted { get; set; }
        /// <summary>
        /// Gets/sets the overall volume.
        /// </summary>
        float Volume { get; set; }
        /// <summary>
        /// Gets/sets the music volume.
        /// </summary>
        float MusicVolume { get; set; }
        /// <summary>
        /// Gets/sets the sound-effect volume.
        /// </summary>
        float SoundVolume { get; set; }

        /// <summary>
        /// Plays the given file.
        /// </summary>
        /// <param name="fileName">The file name of the sound to play.</param>
        /// <param name="playOptions">Play options.</param>
        /// <returns>The identifier of the sound.</returns>
        int Play(string fileName, PlayOptions playOptions);
        /// <summary>
        /// Plays the tune represented by its speed and tune.
        /// </summary>
        /// <param name="speed">The speed to use for playback.</param>
        /// <param name="tune">The tune code. Must be formatted like in ZZT.</param>
        /// <param name="playOptions">Optional play options. The property "IsMusic" is ignored here.</param>
        /// <returns>The identifier of the tune.</returns>
        int PlayTune(int speed, string tune, PlayOptions playOptions);
        /// <summary>
        /// Stops playback of the given (looped) sound.
        /// </summary>
        /// <param name="id">The identifier of the sound to stop.</param>
        void Stop(int id);
        /// <summary>
        /// Stops playback of the given (looped) tune.
        /// </summary>
        /// <param name="id">The identifier of the tune to stop.</param>
        void StopTune(int id);
    }
}
